$('#button').click(function() {
    // Get all the forms elements and their values in one step
    var username = $('#username').val();
    var password = $('#password').val(); 
    $.ajax({
      type: "POST",
      url:  "scripts/login.php",
      data: "username="+username+"&password="+password,
      success: function(msg){
      if(msg != '')
        alert( msg);
        else{
          var url = "html5uploader/uploader_index.php";    
          $(location).attr('href',url);
        }
      },
      error: function(xhr, ajaxOptions, thrownError){
        alert(xhr.status);
        alert(xhr.statusText);
        alert(thrownError);
      }
 });

});